<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#box1{
				width: 100px;
				height: 100px;
				background-color: pink;
				
				position: absolute;
			}
			
	
		</style>
		<script type="text/javascript">
			window.onload = function(){
				var div =  document.getElementById("box1");
			
				document.onmousemove = function(event){
					event = event || window.event;
					
					var st = document.body.scrollTop || document.documentElement.scrollTop;
					var sl = document.body.scrollLeft || document.documentElement.scrollLeft;
					
					var left = event.clientX;
					var top = event.clientY;
					
					box1.style.left = left + sl +"px";
					box1.style.top = top +st + "px";
				
				
				};
			};
			
		</script>
	</head>
	<body style="width: 1000px;height: 2000px;">
		<div id="box1"></div>
	</body>
</html>
